<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>相册详情 - 夏日海边旅行</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    
    <style>
        :root {
            --primary: #3b82f6;
            --primary-light: #60a5fa;
            --primary-dark: #2563eb;
            --secondary: #8b5cf6;
            --success: #10b981;
            --warning: #f59e0b;
            --danger: #ef4444;
            --text-primary: #111827;
            --text-secondary: #6b7280;
            --text-light: #9ca3af;
            --bg-light: #f9fafb;
            --bg-white: #ffffff;
            --border-light: #e5e7eb;
            --border-medium: #d1d5db;
            --radius: 8px;
            --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: var(--bg-light);
            color: var(--text-primary);
            padding-top: 55px;
            padding-bottom: 60px;
        }
        
        /* 顶部导航 */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 55px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 15px;
            z-index: 1000;
            border-bottom: 1px solid var(--border-light);
        }
        
        .nav-title {
            font-size: 1.1rem;
            font-weight: 600;
        }
        
        .nav-actions {
            display: flex;
            gap: 15px;
            font-size: 1.2rem;
        }
        
        /* 相册头部信息 */
        .album-header {
            background-color: var(--bg-white);
            padding: 15px;
            border-bottom: 1px solid var(--border-light);
        }
        
        .album-title {
            font-size: 1.3rem;
            font-weight: 600;
            margin-bottom: 10px;
        }
        
        .album-meta {
            display: flex;
            align-items: center;
            color: var(--text-secondary);
            font-size: 0.9rem;
            margin-bottom: 12px;
        }
        
        .album-creator {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-right: 15px;
        }
        
        .creator-avatar {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            object-fit: cover;
        }
        
        .album-date {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        
        .album-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 10px;
        }
        
        .album-tag {
            padding: 4px 10px;
            background-color: var(--bg-light);
            border-radius: 12px;
            font-size: 0.8rem;
            color: var(--text-secondary);
        }
        
        /* 相册操作按钮 */
        .album-actions {
            display: flex;
            justify-content: space-between;
            padding: 10px 15px;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
        }
        
        .action-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            color: var(--text-secondary);
            font-size: 0.8rem;
        }
        
        .action-btn i {
            font-size: 1.2rem;
            margin-bottom: 3px;
        }
        
        .action-btn.active {
            color: var(--primary);
        }
        
        /* 图片预览区 */
        .image-preview {
            position: relative;
            background-color: black;
        }
        
        .preview-image {
            width: 100%;
            display: block;
        }
        
        .image-pagination {
            position: absolute;
            top: 10px;
            right: 10px;
            background-color: rgba(0, 0, 0, 0.6);
            color: white;
            padding: 3px 8px;
            border-radius: 12px;
            font-size: 0.8rem;
        }
        
        .preview-actions {
            position: absolute;
            bottom: 15px;
            left: 0;
            right: 0;
            display: flex;
            justify-content: space-between;
            padding: 0 15px;
        }
        
        .preview-action-btn {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: rgba(0, 0, 0, 0.6);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            border: none;
        }
        
        /* 缩略图导航 */
        .thumbnail-nav {
            padding: 10px 15px;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
            overflow-x: auto;
        }
        
        .thumbnail-container {
            display: flex;
            gap: 8px;
        }
        
        .thumbnail-item {
            width: 80px;
            height: 80px;
            border-radius: var(--radius);
            overflow: hidden;
            flex-shrink: 0;
            border: 2px solid transparent;
        }
        
        .thumbnail-item.active {
            border-color: var(--primary);
        }
        
        .thumbnail-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        /* 内容标签 */
        .content-tabs {
            display: flex;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
        }
        
        .content-tab {
            flex: 1;
            text-align: center;
            padding: 12px 0;
            font-size: 0.95rem;
            font-weight: 500;
            color: var(--text-secondary);
            position: relative;
        }
        
        .content-tab.active {
            color: var(--primary);
        }
        
        .content-tab.active::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 2px;
            background-color: var(--primary);
        }
        
        /* 评论区 */
        .comments-section {
            background-color: var(--bg-white);
            padding: 15px;
        }
        
        .comments-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
        }
        
        .comments-title {
            font-size: 1rem;
            font-weight: 600;
        }
        
        .sort-comments {
            color: var(--text-secondary);
            font-size: 0.85rem;
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        /* 评论输入框 */
        .comment-input-group {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
        }
        
        .user-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            object-fit: cover;
            flex-shrink: 0;
        }
        
        .comment-input-container {
            flex: 1;
        }
        
        .comment-input {
            width: 100%;
            padding: 10px 12px;
            border-radius: 20px;
            border: 1px solid var(--border-light);
            background-color: var(--bg-light);
            font-size: 0.9rem;
            resize: none;
            height: 36px;
        }
        
        .comment-input:focus {
            outline: none;
            border-color: var(--primary-light);
        }
        
        .input-actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            margin-top: 8px;
        }
        
        .input-action-btn {
            color: var(--text-secondary);
            background: none;
            border: none;
            font-size: 1rem;
        }
        
        .send-comment {
            padding: 5px 15px;
            background-color: var(--primary);
            color: white;
            border-radius: 15px;
            font-size: 0.9rem;
            border: none;
        }
        
        /* 评论列表 */
        .comments-list {
            margin-bottom: 20px;
        }
        
        .comment-item {
            display: flex;
            gap: 10px;
            margin-bottom: 15px;
        }
        
        .comment-content {
            flex: 1;
        }
        
        .comment-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 5px;
        }
        
        .comment-author {
            font-weight: 500;
            font-size: 0.9rem;
        }
        
        .comment-time {
            color: var(--text-light);
            font-size: 0.8rem;
        }
        
        .comment-text {
            background-color: var(--bg-light);
            padding: 8px 12px;
            border-radius: 15px;
            font-size: 0.9rem;
            margin-bottom: 5px;
        }
        
        .comment-actions {
            display: flex;
            gap: 15px;
            font-size: 0.85rem;
        }
        
        .comment-action {
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            gap: 3px;
        }
        
        .comment-action.liked {
            color: var(--danger);
        }
        
        /* 回复列表 */
        .replies-list {
            margin-left: 46px;
            margin-top: 10px;
        }
        
        .reply-item {
            display: flex;
            gap: 10px;
            margin-bottom: 10px;
        }
        
        .reply-content {
            flex: 1;
        }
        
        .reply-text {
            background-color: var(--bg-light);
            padding: 6px 10px;
            border-radius: 12px;
            font-size: 0.85rem;
            margin-bottom: 3px;
        }
        
        .reply-text .author {
            font-weight: 500;
            color: var(--primary);
        }
        
        /* 回复输入框 */
        .reply-input-group {
            display: flex;
            gap: 10px;
            margin-left: 46px;
            margin-top: 10px;
            margin-bottom: 15px;
        }
        
        .reply-input {
            flex: 1;
            padding: 6px 12px;
            border-radius: 15px;
            border: 1px solid var(--border-light);
            background-color: var(--bg-light);
            font-size: 0.85rem;
        }
        
        .reply-input:focus {
            outline: none;
            border-color: var(--primary-light);
        }
        
        .send-reply {
            color: var(--primary);
            background: none;
            border: none;
            font-size: 0.9rem;
            white-space: nowrap;
        }
        
        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 60px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-around;
            align-items: center;
            border-top: 1px solid var(--border-light);
            z-index: 1000;
        }
        
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            color: var(--text-secondary);
            font-size: 0.7rem;
        }
        
        .nav-item i {
            font-size: 1.2rem;
            margin-bottom: 3px;
        }
        
        .nav-item.active {
            color: var(--primary);
        }
        
        /* 图片查看器 */
        .image-viewer {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: black;
            z-index: 3000;
            display: none;
            align-items: center;
            justify-content: center;
        }
        
        .image-viewer.show {
            display: flex;
        }
        
        .viewer-image {
            max-width: 100%;
            max-height: 100vh;
            object-fit: contain;
        }
        
        .viewer-close {
            position: absolute;
            top: 15px;
            right: 15px;
            color: white;
            font-size: 1.5rem;
            background: none;
            border: none;
        }
        
        .viewer-prev, .viewer-next {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            color: white;
            font-size: 2rem;
            background: none;
            border: none;
            padding: 20px 10px;
        }
        
        .viewer-prev {
            left: 0;
        }
        
        .viewer-next {
            right: 0;
        }
        
        /* 加载更多 */
        .load-more {
            text-align: center;
            padding: 10px 0;
        }
        
        .load-more-btn {
            padding: 6px 20px;
            border-radius: 15px;
            border: 1px solid var(--border-light);
            background-color: white;
            color: var(--text-secondary);
            font-size: 0.9rem;
        }
    </style>
</head>
<body>
    <!-- 顶部导航 -->
    <div class="top-nav">
        <div class="nav-left">
            <i class="fas fa-arrow-left"></i>
        </div>
        <div class="nav-title">相册详情</div>
        <div class="nav-actions">
            <i class="far fa-share-alt"></i>
            <i class="far fa-ellipsis-h"></i>
        </div>
    </div>
    
    <!-- 相册头部信息 -->
    <div class="album-header">
        <div class="album-title">夏日海边旅行</div>
        <div class="album-meta">
            <div class="album-creator">
                <img src="https://picsum.photos/id/64/100/100" alt="创作者头像" class="creator-avatar">
                <span>旅行爱好者</span>
            </div>
            <div class="album-date">
                <i class="far fa-calendar-alt"></i>
                <span>2023-07-15</span>
            </div>
        </div>
        <div class="album-tags">
            <div class="album-tag">旅行</div>
            <div class="album-tag">海边</div>
            <div class="album-tag">夏季</div>
            <div class="album-tag">3人</div>
        </div>
        <p>和朋友们一起去海边度过的完美假期，阳光、沙滩、海浪，还有美味的海鲜！</p>
    </div>
    
    <!-- 相册操作按钮 -->
    <div class="album-actions">
        <div class="action-btn">
            <i class="far fa-heart"></i>
            <span>89</span>
        </div>
        <div class="action-btn active">
            <i class="far fa-comment"></i>
            <span>24</span>
        </div>
        <div class="action-btn">
            <i class="far fa-bookmark"></i>
            <span>收藏</span>
        </div>
        <div class="action-btn">
            <i class="far fa-user-plus"></i>
            <span>分享</span>
        </div>
        <div class="action-btn">
            <i class="fas fa-download"></i>
            <span>保存</span>
        </div>
    </div>
    
    <!-- 图片预览区 -->
    <div class="image-preview">
        <img src="https://picsum.photos/id/26/800/1200" alt="相册图片" class="preview-image" id="mainImage">
        <div class="image-pagination">1/24</div>
        <div class="preview-actions">
            <button class="preview-action-btn">
                <i class="far fa-heart"></i>
            </button>
            <button class="preview-action-btn">
                <i class="far fa-comment"></i>
            </button>
            <button class="preview-action-btn">
                <i class="fas fa-share-alt"></i>
            </button>
        </div>
    </div>
    
    <!-- 缩略图导航 -->
    <div class="thumbnail-nav">
        <div class="thumbnail-container">
            <div class="thumbnail-item active">
                <img src="https://picsum.photos/id/26/100/100" alt="缩略图1" class="thumbnail-image">
            </div>
            <div class="thumbnail-item">
                <img src="https://picsum.photos/id/27/100/100" alt="缩略图2" class="thumbnail-image">
            </div>
            <div class="thumbnail-item">
                <img src="https://picsum.photos/id/28/100/100" alt="缩略图3" class="thumbnail-image">
            </div>
            <div class="thumbnail-item">
                <img src="https://picsum.photos/id/29/100/100" alt="缩略图4" class="thumbnail-image">
            </div>
            <div class="thumbnail-item">
                <img src="https://picsum.photos/id/30/100/100" alt="缩略图5" class="thumbnail-image">
            </div>
            <div class="thumbnail-item">
                <img src="https://picsum.photos/id/31/100/100" alt="缩略图6" class="thumbnail-image">
            </div>
        </div>
    </div>
    
    <!-- 内容标签 -->
    <div class="content-tabs">
        <div class="content-tab active">评论 (24)</div>
        <div class="content-tab">参与人员 (3)</div>
        <div class="content-tab">更多信息</div>
    </div>
    
    <!-- 评论区 -->
    <div class="comments-section">
        <div class="comments-header">
            <div class="comments-title">全部评论</div>
            <div class="sort-comments">
                <span>最新</span>
                <i class="fas fa-chevron-down"></i>
            </div>
        </div>
        
        <!-- 评论输入框 -->
        <div class="comment-input-group">
            <img src="https://picsum.photos/id/91/100/100" alt="用户头像" class="user-avatar">
            <div class="comment-input-container">
                <textarea class="comment-input" placeholder="添加评论..."></textarea>
                <div class="input-actions">
                    <button class="input-action-btn">
                        <i class="far fa-image"></i>
                    </button>
                    <button class="input-action-btn">
                        <i class="far fa-smile"></i>
                    </button>
                    <button class="send-comment">发送</button>
                </div>
            </div>
        </div>
        
        <!-- 评论列表 -->
        <div class="comments-list">
            <!-- 评论1 -->
            <div class="comment-item">
                <img src="https://picsum.photos/id/65/100/100" alt="用户头像" class="user-avatar">
                <div class="comment-content">
                    <div class="comment-header">
                        <div class="comment-author">海浪声声</div>
                        <div class="comment-time">2小时前</div>
                    </div>
                    <div class="comment-text">这片海看起来太美了！请问这是哪里呀？</div>
                    <div class="comment-actions">
                        <div class="comment-action">
                            <i class="far fa-heart"></i>
                            <span>12</span>
                        </div>
                        <div class="comment-action reply-btn">
                            <i class="far fa-comment"></i>
                            <span>回复</span>
                        </div>
                    </div>
                    
                    <!-- 回复列表 -->
                    <div class="replies-list">
                        <div class="reply-item">
                            <img src="https://picsum.photos/id/64/100/100" alt="用户头像" class="user-avatar">
                            <div class="reply-content">
                                <div class="comment-header">
                                    <div class="comment-author">旅行爱好者</div>
                                    <div class="comment-time">1小时前</div>
                                </div>
                                <div class="reply-text">
                                    <span class="author">@海浪声声</span> 这是青岛的金沙滩哦，确实很美！
                                </div>
                                <div class="comment-actions">
                                    <div class="comment-action">
                                        <i class="far fa-heart"></i>
                                        <span>5</span>
                                    </div>
                                    <div class="comment-action reply-btn">
                                        <i class="far fa-comment"></i>
                                        <span>回复</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 回复输入框 (默认隐藏) -->
                    <div class="reply-input-group" style="display: none;">
                        <img src="https://picsum.photos/id/91/100/100" alt="用户头像" class="user-avatar">
                        <input type="text" class="reply-input" placeholder="回复 @海浪声声...">
                        <button class="send-reply">发送</button>
                    </div>
                </div>
            </div>
            
            <!-- 评论2 -->
            <div class="comment-item">
                <img src="https://picsum.photos/id/66/100/100" alt="用户头像" class="user-avatar">
                <div class="comment-content">
                    <div class="comment-header">
                        <div class="comment-author">美食探险家</div>
                        <div class="comment-time">昨天 18:35</div>
                    </div>
                    <div class="comment-text">看起来天气特别好，海水也很蓝，一定拍了很多美照吧！</div>
                    <div class="comment-actions">
                        <div class="comment-action liked">
                            <i class="fas fa-heart"></i>
                            <span>8</span>
                        </div>
                        <div class="comment-action reply-btn">
                            <i class="far fa-comment"></i>
                            <span>回复</span>
                        </div>
                    </div>
                    
                    <!-- 回复输入框 (默认隐藏) -->
                    <div class="reply-input-group" style="display: none;">
                        <img src="https://picsum.photos/id/91/100/100" alt="用户头像" class="user-avatar">
                        <input type="text" class="reply-input" placeholder="回复 @美食探险家...">
                        <button class="send-reply">发送</button>
                    </div>
                </div>
            </div>
            
            <!-- 评论3 -->
            <div class="comment-item">
                <img src="https://picsum.photos/id/67/100/100" alt="用户头像" class="user-avatar">
                <div class="comment-content">
                    <div class="comment-header">
                        <div class="comment-author">沙滩漫步</div>
                        <div class="comment-time">2天前</div>
                    </div>
                    <div class="comment-text">我们上周也去了海边，不过人好多，你们去的时候人看起来不多呀</div>
                    <div class="comment-actions">
                        <div class="comment-action">
                            <i class="far fa-heart"></i>
                            <span>3</span>
                        </div>
                        <div class="comment-action reply-btn">
                            <i class="far fa-comment"></i>
                            <span>回复</span>
                        </div>
                    </div>
                    
                    <!-- 回复列表 -->
                    <div class="replies-list">
                        <div class="reply-item">
                            <img src="https://picsum.photos/id/64/100/100" alt="用户头像" class="user-avatar">
                            <div class="reply-content">
                                <div class="comment-header">
                                    <div class="comment-author">旅行爱好者</div>
                                    <div class="comment-time">2天前</div>
                                </div>
                                <div class="reply-text">
                                    <span class="author">@沙滩漫步</span> 我们是工作日去的，周末人确实会多很多
                                </div>
                                <div class="comment-actions">
                                    <div class="comment-action">
                                        <i class="far fa-heart"></i>
                                        <span>2</span>
                                    </div>
                                    <div class="comment-action reply-btn">
                                        <i class="far fa-comment"></i>
                                        <span>回复</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <div class="reply-item">
                            <img src="https://picsum.photos/id/67/100/100" alt="用户头像" class="user-avatar">
                            <div class="reply-content">
                                <div class="comment-header">
                                    <div class="comment-author">沙滩漫步</div>
                                    <div class="comment-time">1天前</div>
                                </div>
                                <div class="reply-text">
                                    <span class="author">@旅行爱好者</span> 原来如此，看来下次要选工作日去才行
                                </div>
                                <div class="comment-actions">
                                    <div class="comment-action">
                                        <i class="far fa-heart"></i>
                                        <span>1</span>
                                    </div>
                                    <div class="comment-action reply-btn">
                                        <i class="far fa-comment"></i>
                                        <span>回复</span>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 回复输入框 (默认隐藏) -->
                    <div class="reply-input-group" style="display: none;">
                        <img src="https://picsum.photos/id/91/100/100" alt="用户头像" class="user-avatar">
                        <input type="text" class="reply-input" placeholder="回复 @沙滩漫步...">
                        <button class="send-reply">发送</button>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 加载更多 -->
        <div class="load-more">
            <button class="load-more-btn">加载更多评论</button>
        </div>
    </div>
    
    <!-- 图片查看器 -->
    <div class="image-viewer" id="imageViewer">
        <button class="viewer-close" id="viewerClose">
            <i class="fas fa-times"></i>
        </button>
        <button class="viewer-prev" id="viewerPrev">
            <i class="fas fa-chevron-left"></i>
        </button>
        <img src="https://picsum.photos/id/26/1200/1800" alt="大图预览" class="viewer-image" id="viewerImage">
        <button class="viewer-next" id="viewerNext">
            <i class="fas fa-chevron-right"></i>
        </button>
    </div>
    
    <!-- 底部导航 -->
    <div class="bottom-nav">
        <div class="nav-item">
            <i class="fas fa-home"></i>
            <span>首页</span>
        </div>
        <div class="nav-item">
            <i class="fas fa-compass"></i>
            <span>发现</span>
        </div>
        <div class="nav-item active">
            <i class="fas fa-images"></i>
            <span>相册</span>
        </div>
        <div class="nav-item">
            <i class="far fa-comment"></i>
            <span>消息</span>
        </div>
        <div class="nav-item">
            <i class="far fa-user"></i>
            <span>我的</span>
        </div>
    </div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // 相册图片数据
        const albumImages = [
            { id: 1, url: "https://picsum.photos/id/26/800/1200", thumbnail: "https://picsum.photos/id/26/100/100" },
            { id: 2, url: "https://picsum.photos/id/27/800/1200", thumbnail: "https://picsum.photos/id/27/100/100" },
            { id: 3, url: "https://picsum.photos/id/28/800/1200", thumbnail: "https://picsum.photos/id/28/100/100" },
            { id: 4, url: "https://picsum.photos/id/29/800/1200", thumbnail: "https://picsum.photos/id/29/100/100" },
            { id: 5, url: "https://picsum.photos/id/30/800/1200", thumbnail: "https://picsum.photos/id/30/100/100" },
            { id: 6, url: "https://picsum.photos/id/31/800/1200", thumbnail: "https://picsum.photos/id/31/100/100" }
        ];
        
        // 当前图片索引
        let currentImageIndex = 0;
        
        // 缩略图点击事件
        const thumbnailItems = document.querySelectorAll('.thumbnail-item');
        const mainImage = document.getElementById('mainImage');
        const imagePagination = document.querySelector('.image-pagination');
        
        thumbnailItems.forEach((item, index) => {
            item.addEventListener('click', () => {
                // 更新选中状态
                thumbnailItems.forEach(i => i.classList.remove('active'));
                item.classList.add('active');
                
                // 更新主图
                currentImageIndex = index;
                mainImage.src = albumImages[index].url;
                updatePagination();
            });
        });
        
        // 更新分页信息
        function updatePagination() {
            imagePagination.textContent = `${currentImageIndex + 1}/${albumImages.length}`;
        }
        
        // 图片查看器功能
        const imageViewer = document.getElementById('imageViewer');
        const viewerImage = document.getElementById('viewerImage');
        const viewerClose = document.getElementById('viewerClose');
        const viewerPrev = document.getElementById('viewerPrev');
        const viewerNext = document.getElementById('viewerNext');
        
        // 打开图片查看器
        mainImage.addEventListener('click', () => {
            viewerImage.src = albumImages[currentImageIndex].url;
            imageViewer.classList.add('show');
            document.body.style.overflow = 'hidden';
        });
        
        // 关闭图片查看器
        viewerClose.addEventListener('click', () => {
            imageViewer.classList.remove('show');
            document.body.style.overflow = '';
        });
        
        // 上一张图片
        function showPrevImage() {
            currentImageIndex = (currentImageIndex - 1 + albumImages.length) % albumImages.length;
            updateImageDisplay();
        }
        
        // 下一张图片
        function showNextImage() {
            currentImageIndex = (currentImageIndex + 1) % albumImages.length;
            updateImageDisplay();
        }
        
        // 更新图片显示
        function updateImageDisplay() {
            mainImage.src = albumImages[currentImageIndex].url;
            viewerImage.src = albumImages[currentImageIndex].url;
            
            // 更新缩略图选中状态
            thumbnailItems.forEach((item, index) => {
                item.classList.toggle('active', index === currentImageIndex);
            });
            
            updatePagination();
        }
        
        // 绑定图片导航事件
        viewerPrev.addEventListener('click', showPrevImage);
        viewerNext.addEventListener('click', showNextImage);
        
        // 点击查看器外部关闭
        imageViewer.addEventListener('click', (e) => {
            if (e.target === imageViewer) {
                imageViewer.classList.remove('show');
                document.body.style.overflow = '';
            }
        });
        
        // 滑动切换图片
        let startX = 0;
        imageViewer.addEventListener('touchstart', (e) => {
            startX = e.touches[0].clientX;
        }, false);
        
        imageViewer.addEventListener('touchend', (e) => {
            if (!startX) return;
            
            const endX = e.changedTouches[0].clientX;
            const diffX = endX - startX;
            
            // 滑动距离超过50px才触发切换
            if (diffX > 50) {
                showPrevImage();
            } else if (diffX < -50) {
                showNextImage();
            }
            
            startX = 0;
        }, false);
        
        // 评论点赞功能
        const likeButtons = document.querySelectorAll('.comment-action');
        likeButtons.forEach(button => {
            if (button.querySelector('.fa-heart')) {
                button.addEventListener('click', () => {
                    const icon = button.querySelector('i');
                    const countEl = button.querySelector('span');
                    let count = parseInt(countEl.textContent);
                    
                    if (icon.classList.contains('far')) {
                        icon.classList.remove('far');
                        icon.classList.add('fas');
                        button.classList.add('liked');
                        countEl.textContent = count + 1;
                    } else {
                        icon.classList.remove('fas');
                        icon.classList.add('far');
                        button.classList.remove('liked');
                        countEl.textContent = count - 1;
                    }
                });
            }
        });
        
        // 回复功能
        const replyButtons = document.querySelectorAll('.reply-btn');
        replyButtons.forEach(button => {
            button.addEventListener('click', () => {
                // 找到对应的回复输入框
                const commentItem = button.closest('.comment-item, .reply-item');
                const replyInputGroup = commentItem.nextElementSibling;
                
                // 隐藏所有其他回复框
                document.querySelectorAll('.reply-input-group').forEach(el => {
                    if (el !== replyInputGroup) {
                        el.style.display = 'none';
                    }
                });
                
                // 切换当前回复框显示状态
                if (replyInputGroup.style.display === 'flex') {
                    replyInputGroup.style.display = 'none';
                } else {
                    replyInputGroup.style.display = 'flex';
                    replyInputGroup.querySelector('.reply-input').focus();
                }
            });
        });
        
        // 发送回复
        const sendReplyButtons = document.querySelectorAll('.send-reply');
        sendReplyButtons.forEach(button => {
            button.addEventListener('click', () => {
                const replyInput = button.previousElementSibling;
                const replyText = replyInput.value.trim();
                
                if (replyText) {
                    // 获取回复框所在的评论项
                    const replyInputGroup = button.parentElement;
                    const repliesList = replyInputGroup.previousElementSibling.classList.contains('replies-list') 
                        ? replyInputGroup.previousElementSibling 
                        : replyInputGroup.parentElement.querySelector('.replies-list');
                    
                    // 如果没有回复列表，则创建一个
                    if (!repliesList) {
                        const newRepliesList = document.createElement('div');
                        newRepliesList.className = 'replies-list';
                        replyInputGroup.before(newRepliesList);
                    }
                    
                    // 创建新回复元素
                    const newReply = document.createElement('div');
                    newReply.className = 'reply-item';
                    newReply.innerHTML = `
                        <img src="https://picsum.photos/id/91/100/100" alt="用户头像" class="user-avatar">
                        <div class="reply-content">
                            <div class="comment-header">
                                <div class="comment-author">我</div>
                                <div class="comment-time">刚刚</div>
                            </div>
                            <div class="reply-text">
                                ${replyText}
                            </div>
                            <div class="comment-actions">
                                <div class="comment-action">
                                    <i class="far fa-heart"></i>
                                    <span>0</span>
                                </div>
                                <div class="comment-action reply-btn">
                                    <i class="far fa-comment"></i>
                                    <span>回复</span>
                                </div>
                            </div>
                        </div>
                    `;
                    
                    // 添加新回复到列表
                    const targetRepliesList = replyInputGroup.parentElement.querySelector('.replies-list') 
                        || replyInputGroup.previousElementSibling;
                    
                    if (targetRepliesList) {
                        targetRepliesList.appendChild(newReply);
                    } else {
                        replyInputGroup.before(newReply);
                    }
                    
                    // 清空输入框并隐藏
                    replyInput.value = '';
                    replyInputGroup.style.display = 'none';
                    
                    // 为新回复绑定事件
                    bindReplyEvents(newReply);
                }
            });
        });
        
        // 发送评论
        const sendCommentButton = document.querySelector('.send-comment');
        sendCommentButton.addEventListener('click', () => {
            const commentInput = document.querySelector('.comment-input');
            const commentText = commentInput.value.trim();
            
            if (commentText) {
                // 创建新评论元素
                const newComment = document.createElement('div');
                newComment.className = 'comment-item';
                newComment.innerHTML = `
                    <img src="https://picsum.photos/id/91/100/100" alt="用户头像" class="user-avatar">
                    <div class="comment-content">
                        <div class="comment-header">
                            <div class="comment-author">我</div>
                            <div class="comment-time">刚刚</div>
                        </div>
                        <div class="comment-text">${commentText}</div>
                        <div class="comment-actions">
                            <div class="comment-action">
                                <i class="far fa-heart"></i>
                                <span>0</span>
                            </div>
                            <div class="comment-action reply-btn">
                                <i class="far fa-comment"></i>
                                <span>回复</span>
                            </div>
                        </div>
                        
                        <!-- 回复输入框 (默认隐藏) -->
                        <div class="reply-input-group" style="display: none;">
                            <img src="https://picsum.photos/id/91/100/100" alt="用户头像" class="user-avatar">
                            <input type="text" class="reply-input" placeholder="回复...">
                            <button class="send-reply">发送</button>
                        </div>
                    </div>
                `;
                
                // 添加新评论到列表顶部
                const commentsList = document.querySelector('.comments-list');
                commentsList.insertBefore(newComment, commentsList.firstChild);
                
                // 清空输入框
                commentInput.value = '';
                
                // 为新评论绑定事件
                bindReplyEvents(newComment);
            }
        });
        
        // 绑定回复相关事件
        function bindReplyEvents(element) {
            // 绑定回复按钮事件
            const replyBtn = element.querySelector('.reply-btn');
            if (replyBtn) {
                replyBtn.addEventListener('click', () => {
                    const replyInputGroup = element.querySelector('.reply-input-group');
                    
                    // 隐藏所有其他回复框
                    document.querySelectorAll('.reply-input-group').forEach(el => {
                        if (el !== replyInputGroup) {
                            el.style.display = 'none';
                        }
                    });
                    
                    // 显示当前回复框
                    replyInputGroup.style.display = 'flex';
                    replyInputGroup.querySelector('.reply-input').focus();
                });
            }
            
            // 绑定点赞事件
            const likeBtn = element.querySelector('.comment-action');
            if (likeBtn && likeBtn.querySelector('.fa-heart')) {
                likeBtn.addEventListener('click', () => {
                    const icon = likeBtn.querySelector('i');
                    const countEl = likeBtn.querySelector('span');
                    let count = parseInt(countEl.textContent) || 0;
                    
                    if (icon.classList.contains('far')) {
                        icon.classList.remove('far');
                        icon.classList.add('fas');
                        likeBtn.classList.add('liked');
                        countEl.textContent = count + 1;
                    } else {
                        icon.classList.remove('fas');
                        icon.classList.add('far');
                        likeBtn.classList.remove('liked');
                        countEl.textContent = count - 1;
                    }
                });
            }
            
            // 绑定发送回复事件
            const sendReplyBtn = element.querySelector('.send-reply');
            if (sendReplyBtn) {
                sendReplyBtn.addEventListener('click', () => {
                    const replyInput = sendReplyBtn.previousElementSibling;
                    const replyText = replyInput.value.trim();
                    
                    if (replyText) {
                        // 创建新回复
                        const newReply = document.createElement('div');
                        newReply.className = 'reply-item';
                        newReply.innerHTML = `
                            <img src="https://picsum.photos/id/91/100/100" alt="用户头像" class="user-avatar">
                            <div class="reply-content">
                                <div class="comment-header">
                                    <div class="comment-author">我</div>
                                    <div class="comment-time">刚刚</div>
                                </div>
                                <div class="reply-text">
                                    ${replyText}
                                </div>
                                <div class="comment-actions">
                                    <div class="comment-action">
                                        <i class="far fa-heart"></i>
                                        <span>0</span>
                                    </div>
                                    <div class="comment-action reply-btn">
                                        <i class="far fa-comment"></i>
                                        <span>回复</span>
                                    </div>
                                </div>
                            </div>
                        `;
                        
                        // 添加到回复列表
                        const repliesList = element.querySelector('.replies-list');
                        if (repliesList) {
                            repliesList.appendChild(newReply);
                        } else {
                            // 创建回复列表
                            const repliesList = document.createElement('div');
                            repliesList.className = 'replies-list';
                            repliesList.appendChild(newReply);
                            element.querySelector('.comment-content').insertBefore(repliesList, element.querySelector('.reply-input-group'));
                        }
                        
                        // 清空并隐藏输入框
                        replyInput.value = '';
                        element.querySelector('.reply-input-group').style.display = 'none';
                        
                        // 绑定事件
                        bindReplyEvents(newReply);
                    }
                });
            }
        }
        
        // 内容标签切换
        const contentTabs = document.querySelectorAll('.content-tab');
        contentTabs.forEach(tab => {
            tab.addEventListener('click', () => {
                contentTabs.forEach(t => t.classList.remove('active'));
                tab.classList.add('active');
                
                // 在实际应用中，这里会切换显示不同内容
                // 如评论、参与人员、更多信息等
            });
        });
        
        // 相册操作按钮
        const actionButtons = document.querySelectorAll('.action-btn');
        actionButtons.forEach(button => {
            button.addEventListener('click', () => {
                // 点赞按钮特殊处理
                if (button.querySelector('.fa-heart')) {
                    button.classList.toggle('active');
                    const icon = button.querySelector('i');
                    const countEl = button.querySelector('span');
                    let count = parseInt(countEl.textContent);
                    
                    if (icon.classList.contains('far')) {
                        icon.classList.remove('far');
                        icon.classList.add('fas');
                        countEl.textContent = count + 1;
                    } else {
                        icon.classList.remove('fas');
                        icon.classList.add('far');
                        countEl.textContent = count - 1;
                    }
                } 
                // 收藏按钮特殊处理
                else if (button.querySelector('.fa-bookmark')) {
                    button.classList.toggle('active');
                    const icon = button.querySelector('i');
                    
                    if (icon.classList.contains('far')) {
                        icon.classList.remove('far');
                        icon.classList.add('fas');
                    } else {
                        icon.classList.remove('fas');
                        icon.classList.add('far');
                    }
                }
                // 其他按钮可以添加相应处理
            });
        });
        
        // 加载更多评论
        document.querySelector('.load-more-btn').addEventListener('click', function() {
            this.innerHTML = '<i class="fas fa-spinner fa-spin"></i> 加载中...';
            
            // 模拟加载延迟
            setTimeout(() => {
                // 克隆一些现有评论作为新评论
                const commentsList = document.querySelector('.comments-list');
                const existingComments = document.querySelectorAll('.comment-item');
                
                existingComments.forEach(comment => {
                    const clonedComment = comment.cloneNode(true);
                    // 更新时间为更早的时间
                    const timeEl = clonedComment.querySelector('.comment-time');
                    timeEl.textContent = `${Math.floor(Math.random() * 7) + 3}天前`;
                    
                    // 重置点赞状态
                    const likeBtn = clonedComment.querySelector('.comment-action');
                    if (likeBtn && likeBtn.querySelector('.fa-heart')) {
                        const icon = likeBtn.querySelector('i');
                        const countEl = likeBtn.querySelector('span');
                        likeBtn.classList.remove('liked');
                        icon.classList.remove('fas');
                        icon.classList.add('far');
                        countEl.textContent = Math.floor(Math.random() * 10);
                    }
                    
                    commentsList.appendChild(clonedComment);
                    bindReplyEvents(clonedComment);
                });
                
                this.textContent = '加载更多评论';
            }, 1500);
        });
    </script>
</body>
</html>
    
